<template>
  <n-config-provider :locale="zhCN" :date-locale="dateZhCN" :theme-overrides="themeOverrides">
    <n-loading-bar-provider :loading-bar-style="loadingBarStyle">
      <x-loading/>
      <n-dialog-provider>
        <x-dialog/>
        <n-message-provider>
          <x-message/>
          <router-view/>
        </n-message-provider>
      </n-dialog-provider>
    </n-loading-bar-provider>
  </n-config-provider>

</template>

<script setup>
import {dateZhCN, NConfigProvider, NDialogProvider, NLoadingBarProvider, NMessageProvider, zhCN} from "naive-ui";
import XMessage from '@/components/x-message.vue'
import XDialog from "@/components/x-dialog.vue"
import XLoading from "./components/x-loading.vue";

const themeOverrides = {
  common: {
    primaryColor: '#536FFF',
    primaryColorHover: 'rgba(83, 111, 255, .9)',
    primaryColorPressed: '#536FFF',
    primaryColorSuppl: 'rgba(83, 111, 255, .9)',
    successColor: '#22B46B',
    // infoColor: '#999999',
    infoColor: '#536FFF',
    warningColor: '#FDAA29',
    errorColor: '#FD494D',
    textColorBase: '#1F2225',
    textColorDisabled: '#888'
  }
}
const loadingBarStyle = {
  loading: {
    'background-color': '#54BC2B',
    height: '3px'
  }
}
</script>

<style scoped>
.n-config-provider {
  height: 100%;
}
</style>
